Contents

GDISTAT 	Help Contents

About GDISTAT

Overviews

GDISTAT Overview

How To ...

Arrange the windows

Select a GDI object into the graph

Update the graph

Use and customize the icon

Change optional settings

Examine an application

Commands

GDISTAT menu

Window menu

Options menu

Other Topics

The Toolbar

The Status Bar


About
 About GDISTAT

The program GDISTAT is written by Derk Steggewentz. You may use, copy and distribute it freely as long as it remains complete and unaltered, including this database.

I would be pleased to receive any comments, bug reports or suggestions for future releases. I may be contacted by e-mail at the addresses below:

On BIX as derks

or on CompuServe as 100333,3206

Database Version 1.00


About2
 About GDISTAT

The program GDISTAT is written by Derk Steggewentz. You may use, copy and distribute it freely as long as it remains complete and unaltered, including this database.

I would be pleased to receive any comments, bug reports or suggestions for future releases. I may be contacted at the addresses below.

You may also contact me on BIX as derks

or CompuServe as 100333,3206

Database Version 1.00


Overview

Purpose

GDISTAT is just another heap walker for the Windows™ operating system. The purpose of this one is to get a quick overview on the Windows system heaps, especially the GDI standard heap, by displaying the information as a graph. That makes it easy to check out an applications resource handling and, in particular, to check out if all GDI resources used by an application are freed properly after quitting the program.

GDISTAT offers in addition the possibility to display basic system heap information if iconized.

Using the program

In most of the cases it will be sufficient to use GDISTAT in its iconized state. It is useful to keep the icon always on top of other windows by making it a topmost window. The icon can be customized using the dialog for changing optional settings. The icon displays information on total used or total free heap space for both, GDI and USER Heap.

Detailed information is available if restoring the window to its normal state. The main window consists of three embedded splitter windows. The window at the top always displays the current GDI heap usage. It shows the number of all GDI objects currently used as well as the amount of memory they use. Also the difference between the previous updating is displayed to watch out changes in the usage. The two windows at the bottom are for the graph. The right one displays the graph itself while the left one is used as graph legend and to select appropriate GDI objects to draw. Take care to select only those GDI objects you really want to examine. Selecting to many objects while the applications window is displayed in its normal state may slow down the systems performance if Periodic Update is selected and the update interval is very short.  If you don't have the Vertical Auto Scale option in the  Settings dialog. selected, it is probably necassary to set a new vertical maximum for the graph using this dialog. Being already at this point all other settings should be completed if desired.

The Periodic Update option should always be selected. Switch it off only under special circumstances and/or if you dont want the GDI Heap data to be recorded and the icon to be updated. The graph can be forced to redraw by simply pressing the Update Now button of the toolbar.

All settings, window positions and window arrangements will be stored if the program exits.

How the program works

The GDISTAT program is a heap walker for the local GDI standard heap. To walk through the heap it uses the TOOLHELP.DLL functions LocalFirst(...) and LocalNext(...). For the free/used percentage information it uses the toolhelp function SystemHeapInfo(...). For more information on these functions and on the GDI see the Windows 3.1 SDK Help.

GDISTAT Files

GDISTAT.EXE	the executable

GDISTAT.HLP	this help file

GDISTAT.INI	created in the WINDOWS\SYSTEM directory

Trademarks

Windows is a trademark of Microsoft Corporation


GDISTAT menu

GDISTAT menu commands

The File menu offers the following commands:

Help	Offers you an index to topics on which you can get help.
About	Displays program information.
Exit	Exits the program.


Window menu

Window menu commands

The Window menu offers the following commands:

Toolbar	Shows or hides the toolbar.
Status Bar	Shows or hides the status bar.
Always on Top	Put the programs window always on top of other windows.


Options menu

Options menu commands

The Options menu offers the following commands:

Settings...

Periodic Update

Update Now

All commands of this menu are available on the Toolbar.


Menu Item Settings

Invoke the dialog to change optional settings.

Shortcuts

Toolbar:

Key:	F3


Menu Item Periodic Update

Controls periodic walking through the GDI standard heap. If this menu item is checked the GDI heap information is read periodically. If the application is minimized the icon will be updated each time if there is a change. If the applications window is open the data in the upper window as well as the graph will be updated each time.

Shortcuts

Toolbar:

Key:	F4


Menu Item Update Now

Immediately reads and displays current GDI heap data. It also may be useful to force a redraw of the whole graph.

Shortcuts

Toolbar:

Key:	F6


Toolbar

The Toolbar offers the following shortcuts for all menu items of the Options menu:

	Invoke Dialog to change optional settings. Equivalent to the Settings menu item of the Options menu.
	Toggle on/off the periodic GDI heap walk. Equivalent to the Periodic Update menu item of the Options menu.
	Immediately read and display GDI heap information. Equivalent to the Update Now menu item of the Options menu.
	Put the application in help mode. The cursor changes to an arrow and a question mark. If clicked on any point of the window specific help is opened on this topic if exists.


Status Bar

The Status Bar

The left area of the status bar describes actions of menu items as you use the arrow keys to navigate through menus. This area similarly shows messages that describe the actions of toolbar buttons as you depress them, before releasing them. If after viewing the description of the toolbar button command you wish not to execute the command, then release the mouse button while the pointer is off the toolbar button.

The right areas of the status bar give information about the current settings . This includes the vertical and horizontal maximum of the graph and the update time.


Change optional settings

Click on the area of the dialog you want help on:

All changes will be stored in GDISTAT.INI in your WINDOWS directory if the program exits.


Show free heap if minimized - Settings Dialog

Select Show free heap to display the amount of free GDI and USER heap space in the icon..

See the topic Icon for more information on the icon.


Show used heap if minimized - Settings Dialog

Select Show used heap to display the amount of used GDI and USER heap space in the icon..

See the topic Icon for more information on the icon.


Change horizontal maximum - Settings Dialog

Select the number of samples for the graph to display. Take a large number to get a better long-term overview or a small number to watch out fast changes in the GDI heap usage. The maximum amount of samples the graph can display is 1000.


Change vertical maximum - Settings Dialog

Select the vertical maximum for the graph to display. It is given in KBytes and the upper limit is 64KB. If Auto is selected this combo box is disabled and the program sets the maximum so that the currently largest selected GDI object fits into the Graph window:


Change update time - Settings Dialog

Select the interval to update display and data. Under some circumstances you may have problems with your system performance if the update interval is very short. That is if there are a lot of drawing actions to do i.e. to many GDI objects are selected for the graph to draw and/or you have selected the Scroll Graph option that may cause much drawing actions under some conditions.


Vertical maximum auto scale - Settings Dialog

The program will select an appropriate vertical maximum so that the currently largest selected GDI object will fit into the graph window.


Draw Graph with Cursor - Settings Dialog

In this mode the drawing is sometimes faster then in the Scroll Graph mode. The graph is drawn behind a vertical line that moves from the left to the right, called cursor.


Scroll Graph - Settings Dialog

Drawing in this mode may sometimes need more time compared with the Draw Graph with Cursor mode, This is the case if the Graph window is partially covered by another window or partially moved out of the desktop window, so that it is not visible in its entire.


Updating the graph

The graph is updated periodically if the Periodic Update option in the Options menu is selected. You may update the graph also manually by clicking on the Update Now menu item in the options menu. Both options are available on the toolbar.

The graph is always re drawn in its entire if selecting or de selecting any GDI object to draw in the lower left window or after some particular changes in the Settings Dialog or after the graph window size has changed.

See also: Select GDI objects into the Graph


Customize the graph

Select a GDI object into the Graph

In the lower right splitter window select the object(s) you want to examine, as shown below. Any selection or de selection in this list triggers a complete redraw of the graph window. If the Auto scale option in the Settings dialog is selected then the new graph will be scaled automatically in a way that it fits into the graph window.


The Icon

The Icon gives basic information about the system heaps. It is divided into two parts, the red bar on the left represents the GDI heap and the right blue one the USER heap. These bars as well as the figures given on the top show either the used or free percentage of the system heaps. What they will display depends on the settings in the Settings Dialog. The icon displays the current heap usage only if the Periodic Update menu item is selected.


Arrange the windows

The frame window consists of three embedded splitter windows. Each of these splitter windows may be arranged separately by picking one of the splitter bars and drag it to the desired position. The cursor then changes its appearance as shown in the picture below. This always causes a complete redraw of the graph because the graph window size changes. All arrangements are stored if quitting the application and restored if starting GDISTAT again.


Examine an application

Examine GDI Heap usage of an application

The sample below demonstrates examining the brush and font usage of a small test application. The amount of brushes rise when the program starts and when invoking the applications dialogs you see  that they use an own font. This sample also proves that all resources used by the application are freed properly.